package programme;

import java.sql.BatchUpdateException;

public class CastingDemo {

	
	public static void main(String[] args) {
		
		
		// Impizititer Cast
		long l = 50;
		double d = 2;
		
		//expliziter Cast
		int i = 1000;
		byte b = (byte) i;
		System.out.println(b);
		
		double dou = 2.45;
		int in = (int) dou;
		System.out.println(in);
	
		
		
		// Komplexe Datentypen
		// Impizititer Cast = upcast
		String s = "....";
		Object o = s;
		
		
		//expliziter Cast = downcast
		s = (String) o;
		
		// Datentyp kontrollieren
		if(o instanceof String) {
			System.out.println("Ja");
		}
		
	}
}
